home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
005
/
prcmauto.arc
/
AUTOPRCM.BAS
next >
Wrap
BASIC Source File
|
1986-03-26
|
10KB
|
184 lines
10 ' AUTOPRCM.BAS - John L. O'Boyle - circa March '86
20 ' This program was developed after seeing a version originally written
30 ' by Keith Peterson.
40 CLS:KEY OFF:DIM F$(100):DIM FX$(100):Q$=CHR$(34):DF$ = "D:\TEMP\"
50 PRINT" ProComm File Transfer Command File Generator."
60 PRINT:PRINT" Creates a ProComm .CMD file to speed up downloads and minimize
70 PRINT" on line time to host systems.";
80 LOCATE 5:PRINT " Enter DRV:subdir to store files (return for "+DF$+")";
90 INPUT DR$:PRINT:IF DR$="" THEN DR$=DF$
100 IF RIGHT$(DR$,1) <> "\" THEN BEEP:LOCATE 15,5:PRINT "Invalid Subdirectory Format - Please re-enter";:GOTO 80
110 PRINT " Select one of the following Host Systems - by NUMBER!"
120 PRINT
130 PRINT " PC-Host...................................1"
140 PRINT " FIDO......................................2"
150 PRINT " RBBS......................................3"
160 PRINT " EXEC-PC...................................4"
170 PRINT " IBBS Systems..............................5"
180 PRINT " PC-Board Systems..........................6"
190 PRINT " The Source IBMSIG.........................7"
200 HOST$=INKEY$:IF HOST$="" THEN GOTO 200
210 HOST=VAL(HOST$):IF HOST < 1 OR HOST > 7 THEN BEEP:GOTO 200
220 ON HOST GOTO 560, 890, 1130, 1220, 1340, 1420, 1580
230 CLS:LOCATE 4,4:PRINT "Select a "+HOSTSYS$+" File Protocol - by NUMBER!"
240 PRINT:PRINT " XMODEM..........................1"
250 ON HOST GOTO 590, 920, 1160, 1700, 1700, 1440, 1700
260 IF XONLY$="Y" THEN CLS:LOCATE 2,4:PRINT "All "+HOSTSYS$+" File Transfers will be via XModem":PRINT:GOTO 300
270 IF XONLY$="K" THEN CLS:LOCATE 2,4:PRINT "All "+HOSTSYS$+" File Transfers will be via Kermit!":PRINT:GOTO 300
280 IF (HOST=1) AND (XFER = 3) THEN GOTO 1810
290 CLS:LOCATE 4
300 IF (HOST=1) AND (XFER > 3) THEN GOTO 1710
310 IF HOST = 1 THEN PRINT "Enter name of file to download (return if done)";:GOTO 330
320 PRINT "Enter name of file to download (return if done)";
330 INPUT F$(N):IF F$(N)="" THEN 490
340 MYLINE=CSRLIN
350 IF LEN(F$(N)) > 12 THEN GOTO 400
360 V=INSTR(F$(N),"."):IF V=0 AND LEN(F$(N)) < 9 THEN GOTO 410
370 IF V > 9 THEN GOTO 400
380 IF V < 2 THEN GOTO 400
390 VL=(LEN(F$(N))-V):IF VL < 4 THEN GOTO 410
400 BEEP:COLOR 31:LOCATE 24,40:PRINT "FILESPEC length error! - Re-enter!";:COLOR 7:LOCATE MYLINE-1,48:GOTO 330
410 UPIT$=F$(N):C$="":FOR I = 1 TO LEN(UPIT$)
420 A = ASC(MID$(UPIT$,I,1))
430 IF A > 96 AND A < 123 THEN A=A-32
440 C$=C$+CHR$(A):NEXT I:F$(N)=C$:N=N+1
450 MYLINE=CSRLIN:LOCATE 24,40:PRINT " ";:LOCATE MYLINE
460 IF HOST>1 THEN CLIN=CSRLIN:LOCATE 1,60:PRINT N;:PRINT "Files so far.";:LOCATE CLIN-1
470 IF (HOST=1) AND (XFER < 5) THEN GOTO 1710
480 GOTO 300
490 PRINT:PRINT "Do you wish an auto - logoff? ";
500 AL$=INKEY$:IF AL$ ="" THEN GOTO 500
510 IF AL$="Y" THEN AL$="y"
520 AL = (AL$<>"y"):PRINT
530 CLS:PRINT:PRINT"Creating ProComm .CMD file (DOWNLOAD.CMD) for "+HOSTSYS$
540 OPEN "DOWNLOAD.CMD" FOR OUTPUT AS #1
550 ON HOST GOTO 720, 1030, 1160, 1250, 1360, 1520, 1600
560 HOSTSYS$="PC-Host"
570 RD$="<Q>uit or <C>hg Dir.":RT$="X to Abort>":PR$="or <Q>uit":CD$="menu or Dir. number":SD$="1"
580 GOTO 230
590 PRINT " XModem...(CRC)..................2"
600 PRINT " YModem..........................3"
610 PRINT " YModem Batch....................4"
620 PRINT " KERMIT..........................5"
630 PRINT
640 XFER$=INKEY$:IF XFER$="" THEN GOTO 640
650 XFER=VAL(XFER$):IF XFER < 1 OR XFER > 5 THEN BEEP:GOTO 640
660 IF XFER = 1 OR XFER = 2 THEN RPR$="X":RP$="%XDX"
670 IF XFER = 3 THEN RPR$="Y":RP$="%XDY"
680 IF XFER = 4 THEN RPR$="Y":RP$="%XDZ"
690 'IF XFER = 4 THEN GOTO 3040 'Flag 2.2 Ymodem Batch Problem
700 IF XFER = 5 THEN RPR$="K":RP$="%XDK":RT$="via Kermit =="
710 GOTO 280
720 FOR X=0 TO N-1: IF X=0 THEN 740
730 PRINT#1,"%I"+Q$+RD$+Q$
740 PAIR$=FX$(X):XXX=INSTR(PAIR$,";")
750 HDR$=LEFT$(FX$(X),(XXX-1))
760 HXX=LEN(FX$(X)):HFN=HXX-XXX
770 HFN$=RIGHT$(FX$(X),HFN)
780 IF HDR$=HDRPRV$ THEN GOTO 800
790 PRINT#1,"%T"+Q$+"C!"+Q$:PRINT#1,"%I"+Q$+CD$+Q$:PRINT#1,"%T"+Q$+HDR$+"*!"+Q$:PRINT#1,"%I"+Q$+RD$+Q$
800 PRINT#1,"%W"+Q$+SD$+Q$:PRINT#1,"%T"+Q$+HFN$+"!"+Q$:PRINT#1,"%I"+Q$+PR$+Q$
810 PRINT#1,"%W"+Q$+SD$+Q$:PRINT#1,"%T"+Q$+RPR$+"!"+Q$:PRINT#1,"%I"+Q$+RT$+Q$
820 IF XFER > 3 THEN PRINT#1,RP$:GOTO 840
830 PRINT#1,RP$+Q$+DR$+F$(X)+Q$
840 HDRPRV$=HDR$
850 NEXT X
860 IF AL THEN 1680
870 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"Q!"+Q$:PRINT#1,"%I"+Q$+" ?"+Q$:PRINT#1,"%T"+Q$+"Q!"+Q$
880 PRINT#1,"%I"+Q$+":>"+Q$:PRINT#1,"%T"+Q$+"Q!"+Q$:PRINT#1,"%H":PRINT#1,"%Q":GOTO 1680
890 HOSTSYS$="FIDO"
900 RD$="? for help:":RT$="to start.":PR$="Q ?:":RFN$="Filename:":SD$="1"
910 GOTO 230
920 PRINT " Telink..........................2"
930 PRINT " Modem7..........................3"
940 PRINT " Kermit..........................4"
950 LOCATE 22,6:PRINT "All "+HOSTSYS$+" Protocols will invoke CRC where possible!";
960 XFER$=INKEY$:IF XFER$="" THEN GOTO 960
970 XFER=VAL(XFER$):IF XFER < 1 OR XFER > 5 THEN BEEP:GOTO 960
980 IF XFER = 1 THEN RPR$="XC":RP$="%XDX"
990 IF XFER = 2 THEN RPR$="TC":RP$="%XDT"
1000 IF XFER = 3 THEN RPR$="MC":RP$="%XDM"
1010 IF XFER = 4 THEN RPR$="K":RP$="%XDK"
1020 GOTO 280
1030 FOR X=0 TO N-1: IF X=0 THEN 1060
1040 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"D!"+Q$:PRINT#1,"%I"+Q$+PR$+Q$
1050 PRINT#1,"%T"+Q$+RPR$+Q$:PRINT#1,"%I"+Q$+RFN$+Q$
1060 PRINT#1,"%T"+Q$+F$(X)+"!"+Q$:PRINT#1,"%I"+Q$+RT$+Q$
1070 IF XFER > 1 THEN PRINT#1,RP$:GOTO 1090
1080 PRINT#1,RP$+Q$+F$(X)+"!"+Q$
1090 NEXT X
1100 IF AL THEN 1680
1110 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"G!"+Q$:PRINT#1,"%I"+Q$+"(y,n):"+Q$
1120 PRINT#1,"%T"+Q$+"N!"+Q$:PRINT#1,"%W"+Q$+SD$+Q$:PRINT#1,"%H":PRINT#1,"%Q":GOTO 1680
1130 HOSTSYS$="RBBS":XONLY$="Y"
1140 RD$="[DIR=ALL]--> ":RT$="file=":RP$="%XDX":SD$="1"
1150 GOTO 260
1160 FOR X=0 TO N-1: IF X=0 THEN 1180
1170 PRINT#1,"%I"+Q$+RD$+Q$
1180 PRINT#1,"%T"+Q$+"D;"F$(X)";X!"+Q$:PRINT#1,"%I"+Q$+RT$+F$(X)Q$:PRINT#1,RP$+Q$+DR$+F$(X)+Q$
1190 NEXT X
1200 IF AL THEN 1680
1210 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"G!"+Q$:PRINT#1,"%H":PRINT#1,"%Q":GOTO 1680
1220 HOSTSYS$="EXEC-PC":XONLY$="Y"
1230 RD$="(?=HELP) --> ":RT$="CONTROL-X To Cancel":RFN$="(ENTER to quit) --> ":RPR$="X":PR$="X,Q,?) ":SD$="1":RP$="%XDX"
1240 GOTO 260
1250 FOR X=0 TO N-1: IF X=0 THEN 1270
1260 PRINT#1,"%I"+Q$+RD$+Q$
1270 PRINT#1,"%T"+Q$+"D"+Q$:PRINT#1,"%I"+Q$+RFN$+Q$:PRINT#1,"%T"+Q$+F$(X)+"!"+Q$
1280 PRINT#1,"%I"+Q$+PR$+Q$:PRINT#1,"%T"+Q$+RPR$+Q$:PRINT#1,"%I"+Q$+RT$+Q$
1290 PRINT#1,RP$+Q$+DR$+F$(X)+Q$
1300 NEXT X
1310 IF AL THEN 1680
1320 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"G"+Q$:PRINT#1,"%I"+Q$+"choice --> "+Q$
1330 PRINT#1,"%T"+Q$+"N"+Q$:PRINT#1,"%H":PRINT#1,"%Q":GOTO 1680
1340 HOSTSYS$="IBBS Systems":XONLY$="Y"
1350 RD$="[DIR=ALL]-->":RT$="file=":RP$="%XDX":GOTO 260
1360 FOR X=0 TO N-1: IF X=0 THEN 1380
1370 PRINT#1,"%I"+Q$+RD$+Q$
1380 PRINT#1,"%T"+Q$+"D;"F$(X)";X!"+Q$:PRINT#1,"%I"+Q$+RT$+F$(X)Q$:PRINT#1,RP$+Q$+DR$+F$(X)+Q$
1390 NEXT X
1400 IF AL THEN 1680
1410 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"G!"+Q$:PRINT#1,"%H":PRINT#1,"%Q":GOTO 1680
1420 HOSTSYS$="PC-BOARD Systems":XONLY$="Y"
1430 RD$="Command?":RT$="to Abort.":RFN$="download?":SD$="2":RP$="%XDX":GOTO 230
1440 PRINT " XModem...(CRC)..................2"
1450 PRINT " YModem..........................3"
1460 PRINT
1470 XFER$=INKEY$:IF XFER$="" THEN GOTO 1470
1480 XFER=VAL(XFER$):IF XFER < 1 OR XFER > 5 THEN BEEP:GOTO 1470
1490 IF XFER = 1 OR XFER = 2 THEN RPR$="X":RP$="%XDX"
1500 IF XFER = 3 THEN RPR$="Y":RP$="%XDY"
1510 GOTO 280
1520 FOR X=0 TO N-1: IF X=0 THEN 1540
1530 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"D!"+Q$:PRINT#1,"%I"+Q$+RFN$+Q$
1540 PRINT#1,"%T"+Q$+F$(X)+"!"+Q$:PRINT#1,"%I"+Q$+RT$+Q$:PRINT#1,RP$+Q$+DR$+F$(X)+Q$
1550 NEXT X
1560 IF AL THEN 1680
1570 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"G!"+Q$:PRINT#1,"%W"+Q$+SD$+Q$:PRINT#1,"%H":PRINT#1,"%Q":GOTO 1680
1580 HOSTSYS$="The Source IBMSIG":XONLY$="K"
1590 RFN$="<.C>ancel:":RD$="(Y/N)?":RT$="computer.":RP$="%XDK":SD$="1":GOTO 260
1600 FOR X=0 TO N-1: IF X=0 THEN 1620
1610 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"Y!"+Q$:PRINT#1,"%I"+Q$+RFN$+Q$
1620 PRINT#1,"%T"+Q$+F$(X)+"!"+Q$:PRINT#1,"%I"+Q$+RT$+Q$:PRINT#1,RP$
1630 NEXT X
1640 IF AL THEN 1680
1650 PRINT#1,"%I"+Q$+RD$+Q$:PRINT#1,"%T"+Q$+"N!"+Q$:PRINT#1,"%I"+Q$+"<H>elp:"+Q$
1660 PRINT#1,"%W"+Q$+SD$+Q$:PRINT#1,"%T"+Q$+"QUIT!"+Q$:PRINT#1,"%I"+Q$+">"+Q$
1670 PRINT#1,"%T"+Q$+"OFF!"+Q$:PRINT#1,"%W"+Q$+"5"+Q$:PRINT#1,"%H":PRINT#1,"%Q"
1680 CLOSE 1:PRINT:PRINT"Ready to run ProComm. At BBS file transfer menu enter ALT-F5. Then"
1690 PRINT"enter .CMD file name 'DOWNLOAD'.":PRINT:PRINT" Don't run unattended!"
1700 SYSTEM
1710 PRINT "Enter Dir#/Fil# pairs separated by ';'. eg; 15;3 ";
1720 CLIN=CSRLIN:INPUT FX$(NN):PRINT:IF FX$(NN)="" THEN N=NN:GOTO 490
1730 V=INSTR(FX$(NN),";"):IF V<1 THEN BEEP:LOCATE CLIN,50:GOTO 1720
1740 PAXR$=FX$(NN):XXX=INSTR(PAXR$,";"):HXR$=LEFT$(FX$(NN),(XXX-1))
1750 HXX=LEN(FX$(NN)):HXN=HXX-XXX:HXN$=RIGHT$(FX$(NN),HXN)
1760 IF VAL(HXR$) < 2 OR VAL(HXR$) > 99 THEN BEEP:LOCATE 25,17:PRINT "Directory out of Range - ReEnter!";:LOCATE CLIN,50:GOTO 1720
1770 IF VAL(HXN$) < 1 OR VAL(HXN$) > 99 THEN BEEP:LOCATE 25,17:PRINT "File Number out of Range - ReEnter!";:LOCATE CLIN,50:GOTO 1720
1780 NN=NN+1:CLIN=CSRLIN:LOCATE 25,17:PRINT " ";:LOCATE 1,60:PRINT NN;:PRINT "Files so far.";:LOCATE CLIN-1
1790 IF (HOST=1) AND (XFER > 3) THEN GOTO 1710
1800 GOTO 300
1810 CLS:LOCATE 24:PRINT "Ymodem for PC-Host systems is only valid for files greater than 1024 bytes!";
1820 LOCATE 25:PRINT ".CMD File will not operate properly if selected files are smaller!";
1830 LOCATE 4:GOTO 300